package com.johanChan.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class PageController {


    @RequestMapping("/index")
    public String index() {
        return "index";
    }

    @RequestMapping("/login")
    public String login() {
        return "login";
    }

    //跳转注册页
    @RequestMapping("/toRegister")
    public String toRegister(){
        return "register";
    }


    //测试未登陆拦截页面
    @RequestMapping("/welcome")
    public String welcome(){
        return "welcome";
    }



    @RequestMapping("/webSocket")
    public String webSocket() {
        ModelAndView mv =new ModelAndView("/webSocket");
        String token = System.currentTimeMillis() + "";
        mv.addObject("token",token);
        return "webSocket";
    }



}
